import { Textarea, Check } from '../imports';

export function TextareaPage() {
	const text = `mulitline text
line 1
line 2
line 3
line 4
line 5
line 6`;
	let textarea: Textarea;
	return (
		<>
			<Textarea
				placeholder="This is a textarea"
				disabled={false}
				readOnly
				maxLength={20}
				lines={2}
				maxLines={10}
				resizeType="auto"
				ref={(t) => (textarea = t)}
			/>
			<Textarea placeholder="This is a disabled textarea" value={text} />
			<br />
			<label>
				<Check
					checked
					onClick={function () {
						textarea.setReadonly(this.checked);
					}}
				/>
				Readonly
			</label>
		</>
	);
}
